import request from '@/utils/request'
import {
    commercialApiUrl,
    contractApiUrl,
} from '../config'
//分包计量列表
export function getSmlList(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/query-measure',
        method: 'post',
        data: data
    })
}

//分包计量列表
export function getStatistical(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/query-measure/count',
        method: 'post',
        data: data
    })
}
//新增分包计量step1
export function addStepOne(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/initiation-process',
        method: 'post',
        data: data
    })
}
//编辑分包计量step1
export function updateStepOne(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure',
        method: 'post',
        data
    })
}


//获取表格
export function getTable(data) {
    return request({
        url: commercialApiUrl + '/merchant/label-types/query',
        method: 'post',
        data: data
    })
}
//查看分包计量step1
export function getStepOneDetail(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure',
        method: 'get',
        params: data
    })
}
//新增分包计量step2
export function submitFormStepTwo(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/confirm',
        method: 'post',
        params: data
    })
}
//删除分包计量step1
export function delStepOne(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/del',
        method: 'post',
        params: data
    })
}

//编辑分包计量step3
export function updateStepThree(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/detail/update',
        method: 'post',
        data
    })
}
//新增分包计量step3
export function addStepThree(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/detail',
        method: 'post',
        data: data
    })
}

//删除分包计量step3
export function delStepThree(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/detail/del',
        method: 'post',
        params: data
    })
}
//编辑分包计量step4
export function updateStepFour(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/review/update',
        method: 'post',
        data
    })
}

//新增分包计量step4
export function addStepFour(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/review',
        method: 'post',
        data: data
    })
}

//删除分包计量step4
export function delStepFour(data) {
    return request({
        url: commercialApiUrl + '/subcontract-measure/subcontract-measure/review/del',
        method: 'post',
        params: data
    })
}

/**
 * 选择分包商
 * @param parameter
 */
export function getSubcontractor(params) {
    console.log(params,'params')
    return request({
        url: commercialApiUrl + '/merchant/subContractor-list',
        method: 'post',
        params
    })
}

/**
 * 选择分包商
 * @param parameter
 */
export function getSubcontractorLegal(params) {
    return request({
        url: contractApiUrl + '/contract',
        method: 'get',
        params
    })
}

/**
 * 选择分包商信用代码
 * @param parameter
 */
 export function getSccByProjectId(data) {
    return request({
        url: contractApiUrl + '/contractNew/getSccByProjectId',
        method: 'post',
        data: data
    })
}